﻿// <copyright file="CoordinateKey.cs" company="City of Portland, BES-ASM">
// </copyright>
// <summary>Implementation of the CoordinateKey struct.</summary>

namespace BESASM.EMGAATS.Arc
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;

  /// <summary>
  /// A structure to use as a single key for a dictionary.
  /// </summary>
  /// <remarks>
  /// Warning: Must remain a struct -- if turned into a class, GetHashCode() and Equals() need to be overridden.
  /// Based on struct Tuple give in the top answer here:
  /// http://stackoverflow.com/questions/1171812/multi-key-dictionary-in-c
  /// </remarks>
  public struct CoordinateKey
  {
    /// <summary>
    /// Gets the X coordinate for the key
    /// </summary>
    public readonly double X;

    /// <summary>
    /// Gets the Y coordinate for the key
    /// </summary>
    public readonly double Y;

    /// <summary>
    /// Initializes a new instance of the <see cref="CoordinateKey"/> struct.
    /// </summary>
    /// <param name="x">The X coordinate for the key</param>
    /// <param name="y">The Y coordinate for the key</param>
    public CoordinateKey(double x, double y)
    {
      this.X = x;
      this.Y = y;
    }
  }
}
